#ifndef _WS2812B_H_
#define _WS2812B_H_

#include <stdint.h>

#ifndef HIGH
#define HIGH 1
#endif

#ifndef LOW
#define LOW 0
#endif

#ifndef LED_ON
#define LED_ON 1
#endif

#ifndef LED_OFF
#define LED_OFF 0
#endif

typedef struct ws2812b {
	struct {
		struct {
			/* 灯带中 RGB 灯个数 */
			int num;
		} fix;
		struct {
			int res;
		} var;
	} cfg;
	struct {
		/* SPI 时钟要求是 2.4MHz */
		void (*spi_write)(uint8_t* bytes, uint32_t length);
	} ops;
	struct {
		int res;
	} priv;
} ws2812b_t;

int ws2812b_write(ws2812b_t* led, uint32_t* color, uint32_t num);

#endif /* _WS2812B_H_*/